@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/dateSelect.css">
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/addComeGo.css?v=1.0.1">
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/dateSelect.js"></script>
    <div class="container">
        <div class="row">
            <div style="margin: 30px;">
                <h3 >修改供应商信息</h3>
            </div>
            <div class="col-md-10 col-md-offset-1">
                <form role="form" action="/admin/supplier_save" method="post" onsubmit="return editCheck()" >
                    {{ csrf_field() }}
                    <input type="text" name="id" value="{{$idInfos->id}}" style="display: none">
                    <div class="form-group">
                        <p class="row_p1 row_p"><span class="row_sp"><span class="xing">*</span>供应类型：</span>
                            <select class="address row_sel row_right"  id="supply_type" name="supply_type">
                                <option value="{{$idInfos->supply_type}}">{{$idInfos->supply_type}}</option>
                                <option value="">请选择</option>
                                <option value="面料">面料</option>
                                <option value="辅料">辅料</option>
                                <option value="毛皮">毛皮</option>
                                <option value="针织">针织</option>
                                <option value="花边">花边</option>
                                <option value="梭织">梭织</option>
                                <option value="工艺">工艺</option>
                                <option value="罗口">罗口</option>
                                <option value="加工厂">加工厂</option>
                            </select>
                        </p>
                    </div>
                    <div class="form-group">
                        <p class="row_p2 row_p" ><span class="row_sp"><span class="xing">*</span>供应商名称：</span><input class="form-control row_inp2 row_inp" maxlength="10" type="text" autocomplete="off" autocorrect="off" id="apply_name" name="name" placeholder="名称" value="{{$idInfos->name}}" /></p>
                        <p class="row_p3 row_p" ><span class="row_sp">供应商简称：</span><input class="form-control row_inp3 row_inp" maxlength="10" type="text" autocomplete="off" autocorrect="off" id="alias" name="alias" placeholder="简称" value="{{$idInfos->alias}}"/></p>
                        <p class="row_p4 row_p" ><span class="row_sp">简拼：</span><input class="form-control row_inp4 row_inp" maxlength="10" type="text" autocomplete="off" autocorrect="off" id="short_name" name="short_name" placeholder="简拼"  value="{{$idInfos->short_name}}"/></p>
                    </div>
                    <div class="form-group">
                        <p class="row_p5 row_p" ><span class="row_sp"><span class="KONG">*</span>供应商代码：</span><input class="form-control row_inp5 row_inp" maxlength="10" type="text" autocomplete="off" autocorrect="off" id="code" name="code" placeholder="代码" value="{{$idInfos->code}}"/></p>
                        <p class="row_p6 row_p" ><span class="row_sp">供应商分类：</span><input class="form-control row_inp6 row_inp" maxlength="10" type="text" autocomplete="off" autocorrect="off"  id="category" name="category" placeholder="分类" value="{{$idInfos->category}}" /></p>
                    </div>
                    <div class="form-group">
                        <p class="row_p7 row_p" ><span class="row_sp"><span class="KONG">*</span>供应商地址：</span>
                        <div style="width:710px;">
                            <select name="web_select" id="web_select" class="web_select address prov" >
                                <option value="">省</option>
                                @foreach ($data as $area)
                                <option value="{{ $area->area_bh }}"
                                        @if($idInfos->area_bh >0 && $area_code['area_code1']['area_bh']==$area->area_bh)
                                        selected="selected"
                                        @endif
                                    >{{ $area->area_name }}
                                </option>
                                @endforeach
                            </select>
                            <select name="web_select1" id="web_select1" class="web_select address city">
                                @if($area_code['area_code2'])
                                <option value="{{$area_code['area_code2']['area_bh']}}">{{$area_code['area_code2']['area_name']}}</option>
                                @endif
                            </select>
                            <select name="web_select2" id="web_select2" class="address region">
                                @if($area_code['area_code3'])
                                <option value="{{$area_code['area_code3']['area_bh']}}">{{$area_code['area_code3']['area_name']}}</option>
                                @endif
                            </select>
                        </div>
                        <input class="form-control row_inp74 row_inp" style="margin-top: 15px;width:710px;" type="text" autocomplete="off" autocorrect="off" maxlength="20" placeholder="详细地址" value="{{$idInfos->address_detail}}" id="address_detail" name="address_detail" />
                        </p>
                    </div>
                    <div class="form-group">
                        <p class="row_p8 row_p" ><span class="row_sp"><span class="KONG">*</span>联系人：</span><input class="form-control row_inp8 row_right" maxlength="4" type="text" autocomplete="off" autocorrect="off" id="contact_person" name="contact_person" placeholder="联系人" value="{{$idInfos->contact_person}}" /></p>
                        <p class="row_p9 row_p" ><span class="row_sp"><span class="xing">*</span>手机号：</span><input class="form-control row_inp9 row_right" maxlength="11" type="text" autocomplete="off" autocorrect="off" id="tel" name="tel"  placeholder="手机号" value="{{$idInfos->tel}}"/></p>
                        <p class="row_p10 row_p" ><span class="row_sp">座机：</span><input class="form-control row_inp10 row_right" maxlength="12" type="text" autocomplete="off" autocorrect="off" id="seat_tel" name="seat_tel" placeholder="座机" value="{{$idInfos->seat_tel}}"/></p>
                    </div>
                    <div class="form-group">
                        <p class="row_p11 row_p" ><span class="row_sp"><span class="KONG">*</span>合作开始：</span><input class="form-control row_inp11"  id="date1"  type="text" id="cooperation_start" name="cooperation_start" placeholder="开始时间"  value="@if($idInfos->cooperation_start =='0000-00-00 00:00:00') @else {{str_limit($idInfos->cooperation_start,10,'')}} @endif" /></p>
                        <p class="row_p12 row_p" ><span class="row_sp">合作终止：</span><input class="form-control row_inp12"  id="date2"  type="text" id="cooperation_end" name="cooperation_end"  placeholder="结束时间"  value="@if($idInfos->cooperation_end =='0000-00-00 00:00:00')@elseif($idInfos->cooperation_end !='' && $idInfos->cooperation_end !='0000-00-00 00:00:00'){{str_limit($idInfos->cooperation_end,10,'')}}@endif" /></p>
                        <p class="row_p13 row_p" ><span class="row_sp">银行账号：</span><input class="form-control row_inp13 row_inp" type="text" autocomplete="off" autocorrect="off" id="bank_account" name="bank_account" placeholder="银行账号" maxlength="19"  value="{{$idInfos->bank_account}}" /></p>
                    </div>
                    <div class="form-group">
                        <p class="row_p14 row_p" ><span class="row_sp"><span class="KONG">*</span>备注：</span>
                            <textarea name="remarks" id="remarks" cols="30" rows="10" maxlength="30" class="form-control row_inp14 row_inp">{{$idInfos->remarks}}</textarea>
                    </div>
                    <div class="form-group">
                        <button type='submit' class='btn btn-success' style="float:left;margin-left: 655px;">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script>
        /*日期插件初始化*/
        $("#date1").dateSelect();
        $("#date2").dateSelect();
    </script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/editSupplier.js?v=1.0.1"></script>
@endsection